home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / eaissu3b.lha / Source_Code / AK_IFF_Fonts_1.AMOS / AK_IFF_Fonts_1.amosSourceCode next >
AMOS Source Code  |  1995-12-30  |  3KB  |  75 lines

  1. ' IFF Fonts tutorial. Written by Andrew "Mushroom" Kellett 
  2. '
  3. ' Example 1 - IFF font 1 out of 56 possibile fonts.
  4. '
  5. ' This program demonstrates a non-proportionate font, with the same
  6. ' parameters for hardly any character. 
  7. '
  8. Dim _ONEX(54) : Dim _ONEY(54) : Dim _ONEXX(54) : Dim _ONEYY(54)
  9. Dim _ONES(54)
  10. ' Create all the needed arrays.
  11.  
  12. Global _ONEX(),_ONEY(),_ONEXX(),_ONEYY(),_ONES()
  13. Global SC$,_SCREEN
  14.  
  15. Unpack 6 To 2 : Screen Hide 2
  16. ' Unpack the font data to a screen, and hide it from view. 
  17.  
  18. Proc _INSTALL_ONE : Rem Prepare the arrays with the Information. 
  19.  
  20. Procedure _INSTALL_ONE
  21.    DAT:
  22.    Data 1,0,38,37,38,40,0,54,37,16,56,0,83,37,28,85,0,109,38,26
  23.    Data 111,0,136,37,26,139,0,163,37,26,165,0,192,37,28,194,0
  24.    Data 215,37,22,218,0,244,37,28,246,0,273,37,28,1,40,33,77,34
  25.    Data 35,40,60,77,26,62,40,92,77,32,94,40,121,77,28,123,40,145,77,24,147,40,169,77
  26.    Data 24,171,40,201,77,32,203,40,230,77,28,234,40,241,77,8
  27.    Data 247,40,269,77,24,1,80,28,117,28,30,80,50,117,22,51,80,97,117,48,99,80
  28.    Data 125,117,28,127,80,164,117,38,166,80,190,117,26,192,80,229,117
  29.    Data 38,231,80,255,117,26,1,120,28,157,28,30,120,53,157,24,55,120,84,157,30
  30.    Data 86,120,117,157,32,118,120,161,157,44,163,120,187,157,26,189,120,214,157,26
  31.    Data 216,120,238,157,24,1,168,8,205,8,12,168,37,190,26,38,168,45,205,8
  32.    Data 47,168,72,201,26,74,168,98,205,26,101,168,132,202,32
  33.    Data 134,168,161,205,28,164,168,171,179,8,173,168,188,205,16,190,168,205,205,16,207,168,222
  34.    Data 194,16,224,168,249,199,26,251,168,258,205,8,1,207,16,244,16,18,207
  35.    Data 43,234,26,45,207,82,244,38,86,207,93,229,8,96,207,118,244,24
  36.    Restore DAT
  37.    J$="0123456789abcdefghijklmnopqrstuvwxyz!-.�$%&'()*+,<=[:/"
  38.    For N=1 To 54 : I$=Mid$(J$,N,1)
  39.       Read _ONEX(N),_ONEY(N),_ONEXX(N),_ONEYY(N),_ONES(N)
  40.    Next N
  41. End Proc
  42.  
  43. Procedure _SCROLL_ONE
  44.    Screen _SCREEN
  45.    Do 
  46.       TEMP=Varptr(SC$) : TEMP2=Len(SC$)
  47.       J$="0123456789abcdefghijklmnopqrstuvwxyz!-.�$%&'()*+,<=[:/ "
  48.       For LOP=0 To TEMP2-1
  49.          CNUM=Instr(J$,Mid$(SC$,LOP+1,1))
  50.          If CNUM=55 Then SCR=20 : Goto NXT
  51.          Screen Copy 2,_ONEX(CNUM),_ONEY(CNUM),_ONEXX(CNUM),_ONEYY(CNUM) To _SCREEN,298,1
  52.          SCR=_ONES(CNUM)
  53.          NXT:
  54.          For LOP1=0 To SCR Step 2
  55.             Screen Swap 
  56.             Wait Vbl 
  57.             K=Mouse Key
  58.             If K=1 and _STATUS=1
  59.                Pop Proc
  60.             End If 
  61.             Screen Copy Physic(_SCREEN),0,0,350,40 To Logic(_SCREEN),-2,0
  62.          Next LOP1
  63.       Next LOP
  64.    Loop 
  65. End Proc
  66.  
  67. ' Demonstrate the Scroller routine.
  68.  
  69. Screen Open 0,370,40,16,Lowres : Paper 0 : Cls : Curs Off : Flash Off 
  70. Screen Display 0,128,,,
  71.  
  72. Get Palette 2 : Screen 0 : _SCREEN=0 : Double Buffer 
  73. Screen Show 0 : Screen To Front 0
  74. SC$="mushroom pd is the best pd library around.    "
  75. Proc _SCROLL_ONE